import { UserForm } from "@/types/user";
import { get, post } from "@/utils/request";
import { RegisterUser } from "@/views/Register";


// 登录账号
export const loginServer = (user: UserForm) => {
	return post("/user/login", user);
};

// 获取注册验证码
export const registerCaptchaServer = (email: string) => {
	return get(`/user/captcha?email=${email}`);
};

// 注册账号
export const registerServer = (registerData: RegisterUser) => {
	return post("/user/register", registerData);
};



// 获取好友列表
export const userFriendshipServer = (name?:string) => {
	return get(`/user/friendship?name=${name || ''}`);
};
